<?php

// Namespace

namespace Loop;


/**
 * CBrowserHelper is a helper that contains various functions to help developers deal with browsers
 *
 * @package		Loop
 * @category	Helper
 */

class CBrowserHelper
{
	/**
	 * Set the browser name and version (Only IE 8 & 9 for now)
	 *
	 * @param $browser 			string 		The browser
	 * @param $browserVersion 	string 		The browser version
	 */

	public function getBrowser(&$browser, &$browserVersion)
	{
		$userAgent = v('SERVER::HTTP_USER_AGENT');

		if (strpos($userAgent, 'MSIE 6.') !== false)
		{
			$browser = BROWSER_IE;
			$browserVersion = 6;
		}
		else if (strpos($userAgent, 'MSIE 7.') !== false)
		{
			$browser = BROWSER_IE;
			$browserVersion = 7;
		} 
		else if (strpos($userAgent, 'MSIE 8.') !== false)
		{
			$browser = BROWSER_IE;
			$browserVersion = 8;
		}
		else if (strpos($userAgent, 'MSIE 9.') !== false)
		{
			$browser = BROWSER_IE;
			$browserVersion = 9;
		}
	}
}

?>
